package com.levenx.validdate.sms;

import com.levenx.properties.SecurityProperties;
import com.levenx.validdate.ValidateCode;
import com.levenx.validdate.ValidateCodeGenerator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;

/**
 * Created by 孙乐进 on 2019/3/1.
 */
@Component("smsCodeGenerator")
public class SmsCodeGenerator implements ValidateCodeGenerator {

    @Autowired
    private SecurityProperties lvxSecurityProperties;

    @Override
    public ValidateCode generate() {
        return new ValidateCode("111", LocalDateTime.now().plusSeconds(lvxSecurityProperties.getRememberMeSeconds()));
    }
}
